<table class="table table-bordered">
    <th>Id</th>
    <th>mois</th>
    <th>ETP</th>
    <th>KM</th>
    <th>NUI</th>
    <th>REP</th>
    <?php
//var_dump($this->leStatsfrais);
    $etp = 0;
    $km = 0;
    $nui = 0;
    $rep = 0;
    $visiteurcourant = $this->lesStatsfrais[0]['idVisiteur'];
    for ($i = 0; $i < count($this->lesStatsfrais); $i++) {
        if ($visiteurcourant == $this->lesStatsfrais[$i]['idVisiteur']) {
            $etp+=$this->lesStatsfrais[$i]['ETP'];
            $km+=$this->lesStatsfrais[$i]['KM'];
            $nui+=$this->lesStatsfrais[$i]['NUI'];
            $rep+=$this->lesStatsfrais[$i]['REP'];
        } else {
            ?> <tr class="success">
                <td>-</td>
                <td>-</td>
                <td><?php echo $etp; ?></td>
                <td><?php echo $km; ?></td>
                <td><?php echo $nui; ?></td>
                <td><?php echo $rep; ?></td></tr> <?php
        $etp = $this->lesStatsfrais[$i]['ETP'];
        $km = $this->lesStatsfrais[$i]['KM'];
        $nui = $this->lesStatsfrais[$i]['NUI'];
        $rep = $this->lesStatsfrais[$i]['REP'];
    }
        ?>

        <tr><td><?php  echo $this->lesStatsfrais[$i]['idVisiteur']; ?></td>
            <td><?php echo $this->lesStatsfrais[$i]['mois']; ?></td>
            <td><?php echo $this->lesStatsfrais[$i]['ETP']; ?></td>
            <td><?php echo $this->lesStatsfrais[$i]['KM']; ?></td>    
            <td><?php echo $this->lesStatsfrais[$i]['NUI']; ?></td> 
            <td><?php echo $this->lesStatsfrais[$i]['REP']; ?></td></tr>     
        <?php
        $visiteurcourant = $this->lesStatsfrais[$i]['idVisiteur'];
    }
    ?>
    <tr class="success">
        <td>-</td>
        <td>-</td>
        <td><?php echo $etp; ?></td>
        <td><?php echo $km; ?></td>
        <td><?php echo $nui; ?></td>
        <td><?php echo $rep; ?></td></tr>

</table>
